import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:sudoku/util/widget_util.dart';
import 'package:sudoku/widget/MenuButton.dart';

class ResetDialog extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.transparent,
      child: Center(
        child: Container(
          width: Get.width * 0.8,
          height: 200,
          decoration: BoxDecoration(
              gradient: dialogGradient,
              borderRadius: BorderRadius.circular(15)),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              const SizedBox(
                height: 15,
              ),
              const Text(
                "是否放弃当前\n重新开始？",
                textAlign: TextAlign.center,
                style: TextStyle(
                    color: Colors.white,
                    fontFamily: "Han",
                    fontSize: 30,
                    fontWeight: FontWeight.bold),
              ),
              const SizedBox(
                height: 25,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  MenuButton(
                      onPressed: () {
                        Get.back();
                      },
                      title: "取消"),
                  MenuButton(
                      onPressed: () {
                        Get.back(result: true);
                      },
                      title: "确定"),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}

Future showResetDialog() {
  return showDialog(
      context: Get.context!,
      builder: (context) {
        return ResetDialog();
      });
}
